package jianzhiOffer;
//剑指 Offer 52. 两个链表的第一个公共节点
public class Num52_getIntersectionNode {
    public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
        ListNode pa = headA;
        ListNode pb = headB;
        while (pa != pb){
            pa = pa == null ? headB :pa.next;
            pb = pb == null ? headA :pb.next;
        }
        return pa;


    }
}
